#ifndef _SFMLINPUT_H__
#define _SFMLINPUT_H__

#include <SFML/Graphics.hpp>
#include "Input.hpp"

namespace openfe
{

  class SFMLInput : public Input
  {
    Game* ga;
    sf::RenderWindow* app;
    bool qu;
  public:
    SFMLInput(SFMLGame* g)
      :ga(g), app(NULL), qu(false) //the type cast is on purpose, it will allow us to get the SFML specific code easily
    {
      app = g->getMainWindow();
    }

    virtual bool quit(){return qu;}

    virtual void update()
    {
      qu = false;
      sf::Event event;
    
      while(app->GetEvent(event))
	{
	  if (event.Type == sf::Event::Closed)
	    qu=true;
	
	  if ((event.Type == sf::Event::KeyPressed) and (event.Key.Code == sf::Key::Escape))
	    qu=true;
	}
    }
  };
}

#endif
